home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TEST / SPAWN.C < prev    next >
C/C++ Source or Header  |  1997-04-13  |  1KB  |  48 lines

  1. //this file is a mess, and will be until I can get this working under Windoze
  2.  
  3. #include <qlib.h>
  4. #include <process.h>
  5. #include <mem.h>
  6. #include <stdio.h>
  7. #include <conio.h>
  8. #include <alloc.h>
  9.  
  10. void main(void) {
  11.   volatile dword a;
  12.   byte *newenviro[]={"env1=Cool","env2=Works!"};
  13.   printf("Total free=%d\n",coreleft());
  14.   printf("Spawn tests\n");
  15.  
  16.   if (spawnle(P_WAIT,"enviro.exe","This","works!",NULL,newenviro)==ERROR) {
  17.     printf("Spawn(\"enviro\") failed!\n");
  18.   }
  19.  
  20.   printf("slap a key...\n");getch();
  21.  
  22.   if (spawnlp(P_WAIT,"args.exe","This","works!",NULL)==ERROR) {
  23.     printf("Spawn(\"args\") failed!\n");
  24.   }
  25.  
  26.   printf("slap a key...\n");getch();
  27.  
  28.   if (spawnlp(P_WAIT,"spawnbat.bAt","This","works","too",NULL)==ERROR) {
  29.     printf("Spawn(\"spawnbat.bat\") failed!\n");
  30.   }
  31.  
  32.   printf("slap a key...\n");getch();
  33.  
  34. }
  35.  
  36. /*/
  37.   asm {
  38.     xor ebx,ebx
  39.     mov ah,51h
  40.     int 21h
  41.     mov a,ebx
  42.     mov es,seldata
  43.     mov ds,seldata
  44.   }
  45.   printf("ebx=%x\n",a);
  46. /*/
  47.  
  48.